package com.xci.platform.auth.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.xci.platform.core.Constant;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统用户
 */
@Data
public class UserEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户主键
     */
    @NotBlank(message = "用户主键不能为空")
    @Size(min = 1, max = 50, message = "用户主键不能超过50个字符")
    @ExcelIgnore
    private String id;
  
    /**
     * 登录账户
     */
    @NotBlank(message = "登录账户不能为空")
    @Size(min = 1, max = 50, message = "登录账户不能超过50个字符")
    @Excel(name = "登录账户")
    private String account;
  
    /**
     * 登录密码
     */
    @Size(min = 0, max = 200, message = "登录密码不能超过200个字符")
    @ExcelIgnore
    private String password;
  
    /**
     * 加密秘钥
     */
    @Size(min = 0, max = 100, message = "加密秘钥不能超过100个字符")
    @ExcelIgnore
    private String secretKey;
  
    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空")
    @Size(min = 1, max = 50, message = "姓名不能超过50个字符")
    @Excel(name = "姓名")
    private String name;
  
    /**
     * 姓名简拼
     */
    @Size(min = 0, max = 50, message = "姓名简拼不能超过50个字符")
    @ExcelIgnore
    private String spell;
  
    /**
     * 手机号码
     */
    @Size(min = 0, max = 50, message = "手机号码不能超过50个字符")
    @Excel(name = "手机号码")
    private String mobile;
  
    /**
     * 电子邮件
     */
    @Size(min = 0, max = 50, message = "电子邮件不能超过50个字符")
    @Excel(name = "电子邮件")
    private String email;
  
    /**
     * 所属组织机构主键
     */
    @NotBlank(message = "所属组织机构主键不能为空")
    @Size(min = 1, max = 50, message = "所属组织机构主键不能超过50个字符")
    @ExcelIgnore
    private String departmentId;
  
    /**
     * 所属组织机构名称
     */
    @NotBlank(message = "所属组织机构名称不能为空")
    @Size(min = 1, max = 50, message = "所属组织机构名称不能超过50个字符")
    @Excel(name = "所属组织机构名称")
    private String departmentName;
  
    /**
     * 密码提示问题
     */
    @Size(min = 0, max = 100, message = "密码提示问题不能超过100个字符")
    @Excel(name = "密码提示问题")
    private String question;
  
    /**
     * 密码提示答案
     */
    @Size(min = 0, max = 100, message = "密码提示答案不能超过100个字符")
    @Excel(name = "密码提示答案")
    private String answer;
  
    /**
     * 登录次数
     */
    @Excel(name = "登录次数")
    private Long loginCount;
  
    /**
     * 是否管理员
     */
    @ExcelIgnore
    private Integer isAdmin;
  
    /**
     * 用户状态
     */
    @NotNull(message = "请指定用户状态")
    @Excel(name = "状态", replace = {"启用_1", "禁用_0"})
    private Integer status;
  
    /**
     * 首次登录时间
     */
    @Excel(name = "首次登录时间", exportFormat = Constant.DefaultDateTimePattern)
    private Date firstVisit;
  
    /**
     * 最后登录时间
     */
    @Excel(name = "最后登录时间", exportFormat = Constant.DefaultDateTimePattern)
    private Date lastVisit;
  
    /**
     * 操作用户主键
     */
    @ExcelIgnore
    private String operateUserId;
  
    /**
     * 操作用户
     */
    @Excel(name = "操作用户")
    private String operateUserName;
  
    /**
     * 操作日期
     */
    @Excel(name = "操作日期", exportFormat = Constant.DefaultDateTimePattern)
    private Date operateDateTime;
  
    /**
     * 备注
     */
    @Size(min = 0, max = 2000, message = "备注不能超过2000个字符")
    @Excel(name = "备注")
    private String remark;
  
}
